package cn.edu.scau.nursingcenter.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import cn.edu.scau.nursingcenter.entiry.User;


/**
  * 用户DAO接口UserRepository
 * @author feng
 *
 */
@Repository
public interface UserRepository extends JpaRepository<User, Integer>{

	/**
	  * 登录
	 * @param username用户名
	 * @param password密码
	 * @return用户对象
	 */
	@Query(value = "from user u where u.user_name = ?1 and u.user_password = ?2")
	User login(@Param("user_name")String username,@Param("user_password")String password);
}
